<% if !bar.kind_of?(Bar)
	 # Workaround for non Bar Objects that have an
	 # relation to the bar object
	 bar = bar.bar
   end %>
<li class="item">
	<%= link_to_bar bar.id, 'medium' %>
	
	<div class="information">
		<h3>
			<%= link_to h(bar.name), :controller => :bars,
									 :action => :show,
									 :id => bar %>
		</h3>
		<p class="adress">
			<span class="street"><%= h(bar.street) %></span>,
			<span class="zipcode"><%= h(bar.zipcode) %></span>
			<span class="city"><%= h(bar.city) %></span>
		</p>
		
		<% if bar.bar_guests.count > 0 %>
			<strong>Stammg&auml;ste:</strong><br />
			
			<ul class="portrait-list">
				<% count = 0 %>
				<% for guest in bar.bar_guests do %>
					<% if count <= 20 %>
						<li class="item" style="width: 30px; height: 30px;">
							<%= link_to_profile guest.user.id, 'mini' %>
						</li>
						<% count = count + 1 %>
					<% end %>
				<% end %>
			</ul>
		<% end %>
	</div>
	
	<div class="links">
		<% if show_links %>
			<p class="links">
				<%= link_to 'Bar ansehen', :controller => :bars, 
							:action => :show, :id => bar %><br />
				<%= link_to "Ich gehe heute hin!", 
							{:controller => :bars,
							 :action => :add_visitor,
							 :id => bar.id},
							{:method => :post,
							 :confirm => "Bist du dir sicher?"} %><br />
				<%= link_to "Stammbar verlassen!", 
							{:action => :destroy,
							 :id => bar.id},
							{:method => :post,
							 :confirm => "Bist du dir sicher?"} %>
			</p>
		<% end %>
	</div>
</li>